package Model;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

//http://zetcode.com/db/postgresqljavatutorial/
public final class DbConnection {

	
	   private String url= "jdbc:postgresql://localhost/bezpieczenstwo_oprogramowania";
	   private String user = "postgres";
	   private String password = "kik";	   
	   
	   private Connection con = null;	   
	   private Statement st = null;
	   
	   
	   public DbConnection(){
		   try{
			   this.con = DriverManager.getConnection(this.url, this.user, this.password);
			   this.st = this.con.createStatement();
			   
			   }catch (Exception e) {
					System.out.print("Błąd: "+e.toString());
				}
	   }
	   
	   public String getURL(){
		   return this.url;
	   }
	   
	   public String getUser(){
		   return this.user;
	   }
	   
	   public String getPassword(){
		   return this.password;
	   }
	   
	   public Connection getConnection(){
		   return this.con;
	   }
	   
	   public Statement getStatement(){
		   return this.st;
	   }
	   
}




